local result = 0
local num = 1
while num <= 100 do
    result = result+num 
    num = num + 1
end
print(result)

result = 0;
for i=1,100 do
    result = result+ i
end
print(result)

result = 0;
for i=1,100 do
    result = result+ i
    if result > 500 then
        break
    end
end
print(result)